<!doctype html>

<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>loremipsum.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>

<div class="clear"></div>

<h2><a href="local_third_party_closure_goog_loremipsum_text_loremipsum.js.html">loremipsum.js</a></h2>

<pre class="prettyprint lang-js">
<a name="line1"></a>//   Copyright 2009 The Closure Library Authors. All Rights Reserved.
<a name="line2"></a>
<a name="line3"></a>/**
<a name="line4"></a> * @fileoverview A generator of lorem ipsum text based on the python
<a name="line5"></a> * implementation at http://code.google.com/p/lorem-ipsum-generator/.
<a name="line6"></a> *
<a name="line7"></a> */
<a name="line8"></a>
<a name="line9"></a>goog.provide(&#39;goog.text.LoremIpsum&#39;);
<a name="line10"></a>
<a name="line11"></a>goog.require(&#39;goog.array&#39;);
<a name="line12"></a>goog.require(&#39;goog.math&#39;);
<a name="line13"></a>goog.require(&#39;goog.string&#39;);
<a name="line14"></a>goog.require(&#39;goog.structs.Map&#39;);
<a name="line15"></a>goog.require(&#39;goog.structs.Set&#39;);
<a name="line16"></a>
<a name="line17"></a>
<a name="line18"></a>/**
<a name="line19"></a> * Generates random strings of &quot;lorem ipsum&quot; text, based on the word
<a name="line20"></a> * distribution of a sample text, using the words in a dictionary.
<a name="line21"></a> * @constructor
<a name="line22"></a> */
<a name="line23"></a>goog.text.LoremIpsum = function() {
<a name="line24"></a>  this.generateChains_(this.sample_);
<a name="line25"></a>  this.generateStatistics_(this.sample_);
<a name="line26"></a>
<a name="line27"></a>  this.initializeDictionary_(this.dictionary_);
<a name="line28"></a>};
<a name="line29"></a>
<a name="line30"></a>
<a name="line31"></a>/**
<a name="line32"></a> * Delimiters that end sentences.
<a name="line33"></a> * @type {Array.&lt;string&gt;}
<a name="line34"></a> * @private
<a name="line35"></a> */
<a name="line36"></a>goog.text.LoremIpsum.DELIMITERS_SENTENCES_ = [&#39;.&#39;, &#39;?&#39;, &#39;!&#39;];
<a name="line37"></a>
<a name="line38"></a>
<a name="line39"></a>/**
<a name="line40"></a> * Regular expression for spliting a text into sentences.
<a name="line41"></a> * @type {RegExp}
<a name="line42"></a> * @private
<a name="line43"></a> */
<a name="line44"></a>goog.text.LoremIpsum.SENTENCE_SPLIT_REGEX_ = /[\.\?\!]/;
<a name="line45"></a>
<a name="line46"></a>
<a name="line47"></a>/**
<a name="line48"></a> * Delimiters that end words.
<a name="line49"></a> * @type {Array.&lt;string&gt;}
<a name="line50"></a> * @private
<a name="line51"></a> */
<a name="line52"></a>goog.text.LoremIpsum.DELIMITERS_WORDS_ = [&#39;,&#39;, &#39;.&#39;, &#39;?&#39;, &#39;!&#39;];
<a name="line53"></a>
<a name="line54"></a>
<a name="line55"></a>/**
<a name="line56"></a> * Regular expression for spliting text into words.
<a name="line57"></a> * @type {RegExp}
<a name="line58"></a> * @private
<a name="line59"></a> */
<a name="line60"></a>goog.text.LoremIpsum.WORD_SPLIT_REGEX_ = /\s/;
<a name="line61"></a>
<a name="line62"></a>
<a name="line63"></a>/**
<a name="line64"></a> * Words that can be used in the generated output.
<a name="line65"></a> * Maps a word-length to a list of words of that length.
<a name="line66"></a> * @type {goog.structs.Map}
<a name="line67"></a> * @private
<a name="line68"></a> */
<a name="line69"></a>goog.text.LoremIpsum.prototype.words_;
<a name="line70"></a>
<a name="line71"></a>
<a name="line72"></a>/**
<a name="line73"></a> * Chains of three words that appear in the sample text
<a name="line74"></a> * Maps a pair of word-lengths to a third word-length and an optional
<a name="line75"></a> * piece of trailing punctuation (for example, a period, comma, etc.).
<a name="line76"></a> * @type {goog.structs.Map}
<a name="line77"></a> * @private
<a name="line78"></a> */
<a name="line79"></a>goog.text.LoremIpsum.prototype.chains_;
<a name="line80"></a>
<a name="line81"></a>
<a name="line82"></a>/**
<a name="line83"></a> * Pairs of word-lengths that can appear at the beginning of sentences.
<a name="line84"></a> * @type {Array}
<a name="line85"></a> */
<a name="line86"></a>goog.text.LoremIpsum.prototype.starts_;
<a name="line87"></a>
<a name="line88"></a>
<a name="line89"></a>/**
<a name="line90"></a> * Averange sentence length in words.
<a name="line91"></a> * @type {number}
<a name="line92"></a> * @private
<a name="line93"></a> */
<a name="line94"></a>goog.text.LoremIpsum.prototype.sentenceMean_;
<a name="line95"></a>
<a name="line96"></a>
<a name="line97"></a>/**
<a name="line98"></a> * Sigma (sqrt of variance) for the sentence length in words.
<a name="line99"></a> * @type {number}
<a name="line100"></a> * @private
<a name="line101"></a> */
<a name="line102"></a>goog.text.LoremIpsum.prototype.sentenceSigma_;
<a name="line103"></a>
<a name="line104"></a>
<a name="line105"></a>/**
<a name="line106"></a> * Averange paragraph length in sentences.
<a name="line107"></a> * @type {number}
<a name="line108"></a> * @private
<a name="line109"></a> */
<a name="line110"></a>goog.text.LoremIpsum.prototype.paragraphMean_;
<a name="line111"></a>
<a name="line112"></a>
<a name="line113"></a>/**
<a name="line114"></a> * Sigma (sqrt of variance) for the paragraph length in sentences.
<a name="line115"></a> * @type {number}
<a name="line116"></a> * @private
<a name="line117"></a> */
<a name="line118"></a>goog.text.LoremIpsum.prototype.paragraphSigma_;
<a name="line119"></a>
<a name="line120"></a>
<a name="line121"></a>/**
<a name="line122"></a> * Generates the chains and starts values required for sentence generation.
<a name="line123"></a> * @param {string} sample The same text.
<a name="line124"></a> * @private
<a name="line125"></a> */
<a name="line126"></a>goog.text.LoremIpsum.prototype.generateChains_ = function(sample) {
<a name="line127"></a>  var words = goog.text.LoremIpsum.splitWords_(sample);
<a name="line128"></a>  var wordInfo = goog.array.map(words, goog.text.LoremIpsum.getWordInfo_);
<a name="line129"></a>
<a name="line130"></a>  var previous = [0, 0];
<a name="line131"></a>  var previousKey = previous.join(&#39;-&#39;);
<a name="line132"></a>  var chains = new goog.structs.Map();
<a name="line133"></a>  var starts = [previousKey];
<a name="line134"></a>  var chainKeys = {};
<a name="line135"></a>
<a name="line136"></a>  goog.array.forEach(wordInfo, function(pair) {
<a name="line137"></a>    var chain = chains.get(previousKey);
<a name="line138"></a>    if (chain) {
<a name="line139"></a>      chain.push(pair);
<a name="line140"></a>    } else {
<a name="line141"></a>      chain = [pair];
<a name="line142"></a>      chains.set(previousKey, chain);
<a name="line143"></a>    }
<a name="line144"></a>
<a name="line145"></a>    if (goog.array.contains(
<a name="line146"></a>        goog.text.LoremIpsum.DELIMITERS_SENTENCES_, pair[1])) {
<a name="line147"></a>      starts.push(previousKey);
<a name="line148"></a>    }
<a name="line149"></a>    chainKeys[previousKey] = previous;
<a name="line150"></a>    previous = [previous[1], pair[0]];
<a name="line151"></a>    previousKey = previous.join(&#39;-&#39;);
<a name="line152"></a>  });
<a name="line153"></a>
<a name="line154"></a>  if (chains.getCount() &gt; 0) {
<a name="line155"></a>    this.chains_ = chains;
<a name="line156"></a>    this.starts_ = starts;
<a name="line157"></a>    this.chainKeys_ = chainKeys;
<a name="line158"></a>  } else {
<a name="line159"></a>    throw Error(&#39;Could not generate chains from sample text.&#39;);
<a name="line160"></a>  }
<a name="line161"></a>};
<a name="line162"></a>
<a name="line163"></a>
<a name="line164"></a>/**
<a name="line165"></a> * Calculates the mean and standard deviation of sentence and paragraph lengths.
<a name="line166"></a> * @param {string} sample The same text.
<a name="line167"></a> * @private
<a name="line168"></a> */
<a name="line169"></a>goog.text.LoremIpsum.prototype.generateStatistics_ = function(sample) {
<a name="line170"></a>  this.generateSentenceStatistics_(sample);
<a name="line171"></a>  this.generateParagraphStatistics_(sample);
<a name="line172"></a>};
<a name="line173"></a>
<a name="line174"></a>
<a name="line175"></a>/**
<a name="line176"></a> * Calculates the mean and standard deviation of the lengths of sentences
<a name="line177"></a> * (in words) in a sample text.
<a name="line178"></a> * @param {string} sample The same text.
<a name="line179"></a> * @private
<a name="line180"></a> */
<a name="line181"></a>goog.text.LoremIpsum.prototype.generateSentenceStatistics_ = function(sample) {
<a name="line182"></a>  var sentences = goog.array.filter(
<a name="line183"></a>      goog.text.LoremIpsum.splitSentences_(sample),
<a name="line184"></a>      goog.text.LoremIpsum.isNotEmptyOrWhitepace_);
<a name="line185"></a>
<a name="line186"></a>  var sentenceLengths = goog.array.map(
<a name="line187"></a>      goog.array.map(sentences, goog.text.LoremIpsum.splitWords_),
<a name="line188"></a>      goog.text.LoremIpsum.arrayLength_);
<a name="line189"></a>  this.sentenceMean_ = goog.math.average.apply(null, sentenceLengths);
<a name="line190"></a>  this.sentenceSigma_ = goog.math.standardDeviation.apply(
<a name="line191"></a>      null, sentenceLengths);
<a name="line192"></a>};
<a name="line193"></a>
<a name="line194"></a>
<a name="line195"></a>/**
<a name="line196"></a> * Calculates the mean and standard deviation of the lengths of paragraphs
<a name="line197"></a> * (in sentences) in a sample text.
<a name="line198"></a> * @param {string} sample The same text.
<a name="line199"></a> * @private
<a name="line200"></a> */
<a name="line201"></a>goog.text.LoremIpsum.prototype.generateParagraphStatistics_ = function(sample) {
<a name="line202"></a>  var paragraphs = goog.array.filter(
<a name="line203"></a>      goog.text.LoremIpsum.splitParagraphs_(sample),
<a name="line204"></a>      goog.text.LoremIpsum.isNotEmptyOrWhitepace_);
<a name="line205"></a>
<a name="line206"></a>  var paragraphLengths = goog.array.map(
<a name="line207"></a>    goog.array.map(paragraphs, goog.text.LoremIpsum.splitSentences_),
<a name="line208"></a>    goog.text.LoremIpsum.arrayLength_);
<a name="line209"></a>
<a name="line210"></a>  this.paragraphMean_ = goog.math.average.apply(null, paragraphLengths);
<a name="line211"></a>  this.paragraphSigma_ = goog.math.standardDeviation.apply(
<a name="line212"></a>      null, paragraphLengths);
<a name="line213"></a>};
<a name="line214"></a>
<a name="line215"></a>
<a name="line216"></a>/**
<a name="line217"></a> * Sets the generator to use a given selection of words for generating
<a name="line218"></a> * sentences with.
<a name="line219"></a> * @param {string} dictionary The dictionary to use.
<a name="line220"></a> */
<a name="line221"></a>goog.text.LoremIpsum.prototype.initializeDictionary_ = function(dictionary) {
<a name="line222"></a>  var dictionaryWords = goog.text.LoremIpsum.splitWords_(dictionary);
<a name="line223"></a>
<a name="line224"></a>  var words = new goog.structs.Map();
<a name="line225"></a>  goog.array.forEach(dictionaryWords, function(word) {
<a name="line226"></a>    var set = words.get(word.length);
<a name="line227"></a>    if (!set) {
<a name="line228"></a>      set = new goog.structs.Set();
<a name="line229"></a>      words.set(word.length, set);
<a name="line230"></a>    }
<a name="line231"></a>    set.add(word);
<a name="line232"></a>  });
<a name="line233"></a>
<a name="line234"></a>  this.words_ = words;
<a name="line235"></a>};
<a name="line236"></a>
<a name="line237"></a>
<a name="line238"></a>/**
<a name="line239"></a> * Picks a random starting chain.
<a name="line240"></a> * @return {Array.&lt;string&gt;} The starting key.
<a name="line241"></a> * @private
<a name="line242"></a> */
<a name="line243"></a>goog.text.LoremIpsum.prototype.chooseRandomStart_ = function() {
<a name="line244"></a>  var key = goog.text.LoremIpsum.randomChoice_(this.starts_);
<a name="line245"></a>  return this.chainKeys_[key];
<a name="line246"></a>};
<a name="line247"></a>
<a name="line248"></a>
<a name="line249"></a>/**
<a name="line250"></a> * Generates a single sentence, of random length.
<a name="line251"></a> * @param {boolean} opt_startWithLorem Whether to start the setnence with the
<a name="line252"></a> *     standard &quot;Lorem ipsum...&quot; first sentence.
<a name="line253"></a> * @return {string} The generated sentence.
<a name="line254"></a> */
<a name="line255"></a>goog.text.LoremIpsum.prototype.generateSentence = function(opt_startWithLorem) {
<a name="line256"></a>  if (this.chains_.getCount() == 0 || this.starts_.length == 0) {
<a name="line257"></a>    throw Error(&#39;No chains created&#39;);
<a name="line258"></a>  }
<a name="line259"></a>
<a name="line260"></a>  if (this.words_.getCount() == 0) {
<a name="line261"></a>    throw Error(&#39;No dictionary&#39;);
<a name="line262"></a>  }
<a name="line263"></a>
<a name="line264"></a>  // The length of the sentence is a normally distributed random variable.
<a name="line265"></a>  var sentenceLength = goog.text.LoremIpsum.randomNormal_(
<a name="line266"></a>      this.sentenceMean_, this.sentenceSigma_)
<a name="line267"></a>  sentenceLength = Math.max(Math.floor(sentenceLength), 1);
<a name="line268"></a>
<a name="line269"></a>  var wordDelimiter = &#39;&#39;; // Defined here in case while loop doesn&#39;t run
<a name="line270"></a>
<a name="line271"></a>  // Start the sentence with &quot;Lorem ipsum...&quot;, if desired
<a name="line272"></a>  var sentence;
<a name="line273"></a>  if (opt_startWithLorem) {
<a name="line274"></a>    var lorem = &#39;lorem ipsum dolor sit amet, consecteteur adipiscing elit&#39;;
<a name="line275"></a>    sentence = goog.text.LoremIpsum.splitWords_(lorem);
<a name="line276"></a>    if (sentence.length &gt; sentenceLength) {
<a name="line277"></a>      sentence.length = sentenceLength;
<a name="line278"></a>    }
<a name="line279"></a>    var lastWord = sentence[sentence.length - 1];
<a name="line280"></a>    var lastChar = lastWord.substring(lastWord.length - 1);
<a name="line281"></a>    if (goog.array.contains(goog.text.LoremIpsum.DELIMITERS_WORDS_, lastChar)) {
<a name="line282"></a>      wordDelimiter = lastChar;
<a name="line283"></a>    }
<a name="line284"></a>  } else {
<a name="line285"></a>    sentence = [];
<a name="line286"></a>  }
<a name="line287"></a>
<a name="line288"></a>  var previous = [];
<a name="line289"></a>  var previousKey = &#39;&#39;;
<a name="line290"></a>  // Generate a sentence from the &quot;chains&quot;
<a name="line291"></a>  while (sentence.length &lt; sentenceLength) {
<a name="line292"></a>    // If the current starting point is invalid, choose another randomly
<a name="line293"></a>    if (!this.chains_.containsKey(previousKey)) {
<a name="line294"></a>      previous = this.chooseRandomStart_();
<a name="line295"></a>      previousKey = previous.join(&#39;-&#39;);
<a name="line296"></a>    }
<a name="line297"></a>
<a name="line298"></a>    // Choose the next &quot;chain&quot; to go to. This determines the next word
<a name="line299"></a>    // length we&#39;ll use, and whether there is e.g. a comma at the end of
<a name="line300"></a>    // the word.
<a name="line301"></a>    var chain = /** @type {Array} */ (goog.text.LoremIpsum.randomChoice_(
<a name="line302"></a>        /** @type {Array} */ (this.chains_.get(previousKey))));
<a name="line303"></a>    var wordLength = chain[0];
<a name="line304"></a>
<a name="line305"></a>    // If the word delimiter contained in the chain is also a sentence
<a name="line306"></a>    // delimiter, then we don&#39;t include it because we don&#39;t want the
<a name="line307"></a>    // sentence to end prematurely (we want the length to match the
<a name="line308"></a>    // sentence_length value).
<a name="line309"></a>    //debugger;
<a name="line310"></a>    if (goog.array.contains(goog.text.LoremIpsum.DELIMITERS_SENTENCES_,
<a name="line311"></a>        chain[1])) {
<a name="line312"></a>      wordDelimiter = &#39;&#39;;
<a name="line313"></a>    } else {
<a name="line314"></a>      wordDelimiter = chain[1];
<a name="line315"></a>    }
<a name="line316"></a>
<a name="line317"></a>    // Choose a word randomly that matches (or closely matches) the
<a name="line318"></a>    // length we&#39;re after.
<a name="line319"></a>    var closestLength = goog.text.LoremIpsum.chooseClosest(
<a name="line320"></a>            this.words_.getKeys(), wordLength);
<a name="line321"></a>    var word = goog.text.LoremIpsum.randomChoice_(
<a name="line322"></a>        this.words_.get(closestLength).getValues());
<a name="line323"></a>
<a name="line324"></a>    sentence.push(word + wordDelimiter);
<a name="line325"></a>    previous = [previous[1], wordLength];
<a name="line326"></a>    previousKey = previous.join(&#39;-&#39;);
<a name="line327"></a>  }
<a name="line328"></a>
<a name="line329"></a>  // Finish the sentence off with capitalisation, a period and
<a name="line330"></a>  // form it into a string
<a name="line331"></a>  sentence = sentence.join(&#39; &#39;);
<a name="line332"></a>  sentence = sentence.slice(0, 1).toUpperCase() + sentence.slice(1);
<a name="line333"></a>  if (sentence.substring(sentence.length - 1) == wordDelimiter) {
<a name="line334"></a>    sentence = sentence.slice(0, sentence.length - 1);
<a name="line335"></a>  }
<a name="line336"></a>  return sentence + &#39;.&#39;;
<a name="line337"></a>};
<a name="line338"></a>
<a name="line339"></a>/**
<a name="line340"></a> * Generates a single lorem ipsum paragraph, of random length.
<a name="line341"></a> * @param {boolean} opt_startWithLorem Whether to start the sentence with the
<a name="line342"></a> *     standard &quot;Lorem ipsum...&quot; first sentence.
<a name="line343"></a> * @return {string} The generated sentence.
<a name="line344"></a> */
<a name="line345"></a>goog.text.LoremIpsum.prototype.generateParagraph = function(
<a name="line346"></a>    opt_startWithLorem) {
<a name="line347"></a>  // The length of the paragraph is a normally distributed random variable.
<a name="line348"></a>  var paragraphLength = goog.text.LoremIpsum.randomNormal_(
<a name="line349"></a>      this.paragraphMean_, this.paragraphSigma_);
<a name="line350"></a>  paragraphLength = Math.max(Math.floor(paragraphLength), 1);
<a name="line351"></a>
<a name="line352"></a>  // Construct a paragraph from a number of sentences.
<a name="line353"></a>  var paragraph = []
<a name="line354"></a>  var startWithLorem = opt_startWithLorem;
<a name="line355"></a>  while (paragraph.length &lt; paragraphLength) {
<a name="line356"></a>      var sentence = this.generateSentence(startWithLorem);
<a name="line357"></a>      paragraph.push(sentence);
<a name="line358"></a>      startWithLorem = false;
<a name="line359"></a>  }
<a name="line360"></a>
<a name="line361"></a>  // Form the paragraph into a string.
<a name="line362"></a>  paragraph = paragraph.join(&#39; &#39;)
<a name="line363"></a>  return paragraph
<a name="line364"></a>};
<a name="line365"></a>
<a name="line366"></a>
<a name="line367"></a>/**
<a name="line368"></a> * Splits a piece of text into paragraphs.
<a name="line369"></a> * @param {string} text The text to split.
<a name="line370"></a> * @return {Array.&lt;string&gt;} An array of paragraphs.
<a name="line371"></a> * @private
<a name="line372"></a> */
<a name="line373"></a>goog.text.LoremIpsum.splitParagraphs_ = function(text) {
<a name="line374"></a>  return text.split(&#39;\n&#39;)
<a name="line375"></a>};
<a name="line376"></a>
<a name="line377"></a>
<a name="line378"></a>/**
<a name="line379"></a> * Splits a piece of text into sentences.
<a name="line380"></a> * @param {string} text The text to split.
<a name="line381"></a> * @return {Array.&lt;string&gt;} An array of sentences.
<a name="line382"></a> * @private
<a name="line383"></a> */
<a name="line384"></a>goog.text.LoremIpsum.splitSentences_ = function(text) {
<a name="line385"></a>  return goog.array.filter(
<a name="line386"></a>      text.split(goog.text.LoremIpsum.SENTENCE_SPLIT_REGEX_),
<a name="line387"></a>      goog.text.LoremIpsum.isNotEmptyOrWhitepace_);
<a name="line388"></a>};
<a name="line389"></a>
<a name="line390"></a>
<a name="line391"></a>/**
<a name="line392"></a> * Splits a piece of text into words..
<a name="line393"></a> * @param {string} text The text to split.
<a name="line394"></a> * @return {Array.&lt;string&gt;} An array of words.
<a name="line395"></a> * @private
<a name="line396"></a> */
<a name="line397"></a>goog.text.LoremIpsum.splitWords_ = function(text) {
<a name="line398"></a>  return goog.array.filter(
<a name="line399"></a>      text.split(goog.text.LoremIpsum.WORD_SPLIT_REGEX_),
<a name="line400"></a>      goog.text.LoremIpsum.isNotEmptyOrWhitepace_);
<a name="line401"></a>};
<a name="line402"></a>
<a name="line403"></a>
<a name="line404"></a>/**
<a name="line405"></a> * Returns the text is not empty or just whitespace.
<a name="line406"></a> * @param {string} text The text to check.
<a name="line407"></a> * @return {boolean} Whether the text is nether empty nor whitespace.
<a name="line408"></a> * @private
<a name="line409"></a> */
<a name="line410"></a>goog.text.LoremIpsum.isNotEmptyOrWhitepace_ = function(text) {
<a name="line411"></a>  return goog.string.trim(text).length &gt; 0;
<a name="line412"></a>};
<a name="line413"></a>
<a name="line414"></a>
<a name="line415"></a>/**
<a name="line416"></a> * Returns the length of an array. Written as a function so it can be used
<a name="line417"></a> * as a function parameter.
<a name="line418"></a> * @param {Array} array The array to check.
<a name="line419"></a> * @return {number} The length of the array.
<a name="line420"></a> */
<a name="line421"></a>goog.text.LoremIpsum.arrayLength_ = function(array) {
<a name="line422"></a>  return array.length;
<a name="line423"></a>};
<a name="line424"></a>
<a name="line425"></a>
<a name="line426"></a>/**
<a name="line427"></a> * Find the number in the list of values that is closest to the target.
<a name="line428"></a> * @param {Array.&lt;number&gt;} values The values.
<a name="line429"></a> * @param {number} target The target value.
<a name="line430"></a> * @return {number} The closest value.
<a name="line431"></a> */
<a name="line432"></a>goog.text.LoremIpsum.chooseClosest = function(values, target) {
<a name="line433"></a>  var closest = values[0];
<a name="line434"></a>  goog.array.forEach(values, function(value) {
<a name="line435"></a>    if (Math.abs(target - value) &lt; Math.abs(target - closest)) {
<a name="line436"></a>      closest = value;
<a name="line437"></a>    }
<a name="line438"></a>  });
<a name="line439"></a>
<a name="line440"></a>  return closest;
<a name="line441"></a>};
<a name="line442"></a>
<a name="line443"></a>/**
<a name="line444"></a> * Gets info about a word used as part of the lorem ipsum algorithm.
<a name="line445"></a> * @param {string} word The word to check.
<a name="line446"></a> * @return {Array} A two element array. The first element is the size of the
<a name="line447"></a> *    word. The second element is the delimter used in the word.
<a name="line448"></a> * @private
<a name="line449"></a> */
<a name="line450"></a>goog.text.LoremIpsum.getWordInfo_ = function(word) {
<a name="line451"></a>  var ret;
<a name="line452"></a>  goog.array.some(goog.text.LoremIpsum.DELIMITERS_WORDS_,
<a name="line453"></a>      function (delimiter) {
<a name="line454"></a>        if (goog.string.endsWith(word, delimiter)) {
<a name="line455"></a>          ret = [word.length - delimiter.length, delimiter];
<a name="line456"></a>          return true;
<a name="line457"></a>        }
<a name="line458"></a>        return false;
<a name="line459"></a>      }
<a name="line460"></a>  );
<a name="line461"></a>  return ret || [word.length, &#39;&#39;];
<a name="line462"></a>};
<a name="line463"></a>
<a name="line464"></a>
<a name="line465"></a>/**
<a name="line466"></a> * Constant used for {@link #randomNormal_}.
<a name="line467"></a> * @type {number}
<a name="line468"></a> * @private
<a name="line469"></a> */
<a name="line470"></a>goog.text.LoremIpsum.NV_MAGICCONST_ = 4 * Math.exp(-0.5) / Math.sqrt(2.0);
<a name="line471"></a>
<a name="line472"></a>
<a name="line473"></a>/**
<a name="line474"></a> * Generates a random number for a normal distribution with the specified
<a name="line475"></a> * mean and sigma.
<a name="line476"></a> * @param {number} mu The mean of the distribution.
<a name="line477"></a> * @param {number} sigma The sigma of the distribution.
<a name="line478"></a> * @private
<a name="line479"></a> */
<a name="line480"></a>goog.text.LoremIpsum.randomNormal_ = function(mu, sigma) {
<a name="line481"></a>  while (true) {
<a name="line482"></a>    var u1 = Math.random();
<a name="line483"></a>    var u2 = 1.0 - Math.random();
<a name="line484"></a>    var z = goog.text.LoremIpsum.NV_MAGICCONST_ * (u1 - 0.5) / u2;
<a name="line485"></a>    var zz = z * z / 4.0;
<a name="line486"></a>    if (zz &lt;= -Math.log(u2)) {
<a name="line487"></a>      break;
<a name="line488"></a>    }
<a name="line489"></a>  }
<a name="line490"></a>  return mu + z * sigma;
<a name="line491"></a>};
<a name="line492"></a>
<a name="line493"></a>
<a name="line494"></a>/**
<a name="line495"></a> * Picks a random element of the array.
<a name="line496"></a> * @param {Array} array The array to pick from.
<a name="line497"></a> * @return {*} An element from the array.
<a name="line498"></a> */
<a name="line499"></a>goog.text.LoremIpsum.randomChoice_ = function(array) {
<a name="line500"></a>  return array[goog.math.randomInt(array.length)];
<a name="line501"></a>};
<a name="line502"></a>
<a name="line503"></a>
<a name="line504"></a>/**
<a name="line505"></a> * Dictionary of words for lorem ipsum.
<a name="line506"></a> * @type {string}
<a name="line507"></a> * @private
<a name="line508"></a> */
<a name="line509"></a>goog.text.LoremIpsum.DICT_ =
<a name="line510"></a>    &#39;a ac accumsan ad adipiscing aenean aliquam aliquet amet ante &#39; +
<a name="line511"></a>    &#39;aptent arcu at auctor augue bibendum blandit class commodo &#39; +
<a name="line512"></a>    &#39;condimentum congue consectetuer consequat conubia convallis cras &#39; +
<a name="line513"></a>    &#39;cubilia cum curabitur curae cursus dapibus diam dictum dictumst &#39; +
<a name="line514"></a>    &#39;dignissim dis dolor donec dui duis egestas eget eleifend elementum &#39; +
<a name="line515"></a>    &#39;elit eni enim erat eros est et etiam eu euismod facilisi facilisis &#39; +
<a name="line516"></a>    &#39;fames faucibus felis fermentum feugiat fringilla fusce gravida &#39; +
<a name="line517"></a>    &#39;habitant habitasse hac hendrerit hymenaeos iaculis id imperdiet &#39; +
<a name="line518"></a>    &#39;in inceptos integer interdum ipsum justo lacinia lacus laoreet &#39; +
<a name="line519"></a>    &#39;lectus leo libero ligula litora lobortis lorem luctus maecenas &#39; +
<a name="line520"></a>    &#39;magna magnis malesuada massa mattis mauris metus mi molestie &#39; +
<a name="line521"></a>    &#39;mollis montes morbi mus nam nascetur natoque nec neque netus &#39; +
<a name="line522"></a>    &#39;nibh nisi nisl non nonummy nostra nulla nullam nunc odio orci &#39; +
<a name="line523"></a>    &#39;ornare parturient pede pellentesque penatibus per pharetra &#39; +
<a name="line524"></a>    &#39;phasellus placerat platea porta porttitor posuere potenti praesent &#39; +
<a name="line525"></a>    &#39;pretium primis proin pulvinar purus quam quis quisque rhoncus &#39; +
<a name="line526"></a>    &#39;ridiculus risus rutrum sagittis sapien scelerisque sed sem semper &#39; +
<a name="line527"></a>    &#39;senectus sit sociis sociosqu sodales sollicitudin suscipit &#39; +
<a name="line528"></a>    &#39;suspendisse taciti tellus tempor tempus tincidunt torquent tortor &#39; +
<a name="line529"></a>    &#39;tristique turpis ullamcorper ultrices ultricies urna ut varius ve &#39; +
<a name="line530"></a>    &#39;vehicula vel velit venenatis vestibulum vitae vivamus viverra &#39; +
<a name="line531"></a>    &#39;volutpat vulputate&#39;;
<a name="line532"></a>
<a name="line533"></a>
<a name="line534"></a>/**
<a name="line535"></a> * A sample to use for generating the distribution of word and sentence lengths
<a name="line536"></a> * in lorem ipsum.
<a name="line537"></a> * @type {string}
<a name="line538"></a> * @private
<a name="line539"></a> */
<a name="line540"></a>goog.text.LoremIpsum.SAMPLE_ =
<a name="line541"></a>    &#39;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean &#39; +
<a name="line542"></a>    &#39;commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus &#39; +
<a name="line543"></a>    &#39;et magnis dis parturient montes, nascetur ridiculus mus. Donec quam &#39; +
<a name="line544"></a>    &#39;felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla &#39; +
<a name="line545"></a>    &#39;consequat massa quis enim. Donec pede justo, fringilla vel, aliquet &#39; +
<a name="line546"></a>    &#39;nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, &#39; +
<a name="line547"></a>    &#39;venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. &#39; +
<a name="line548"></a>    &#39;Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean &#39; +
<a name="line549"></a>    &#39;vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat &#39; +
<a name="line550"></a>    &#39;vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra &#39; +
<a name="line551"></a>    &#39;quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius &#39; +
<a name="line552"></a>    &#39;laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel &#39; +
<a name="line553"></a>    &#39;augue. Curabitur ullamcorper ultricies nisi. Nam eget dui.\n\n&#39; +
<a name="line554"></a>
<a name="line555"></a>    &#39;Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem &#39; +
<a name="line556"></a>    &#39;quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam &#39; +
<a name="line557"></a>    &#39;nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec &#39; +
<a name="line558"></a>    &#39;odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis &#39; +
<a name="line559"></a>    &#39;faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus &#39; +
<a name="line560"></a>    &#39;tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales &#39; +
<a name="line561"></a>    &#39;sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit &#39; +
<a name="line562"></a>    &#39;cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend &#39; +
<a name="line563"></a>    &#39;sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, &#39; +
<a name="line564"></a>    &#39;metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis &#39; +
<a name="line565"></a>    &#39;hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci &#39; +
<a name="line566"></a>    &#39;luctus et ultrices posuere cubilia Curae; In ac dui quis mi &#39; +
<a name="line567"></a>    &#39;consectetuer lacinia.\n\n&#39; +
<a name="line568"></a>
<a name="line569"></a>    &#39;Nam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet &#39; +
<a name="line570"></a>    &#39;nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer &#39; +
<a name="line571"></a>    &#39;ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent &#39; +
<a name="line572"></a>    &#39;adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy &#39; +
<a name="line573"></a>    &#39;metus. Vestibulum volutpat pretium libero. Cras id dui. Aenean ut eros &#39; +
<a name="line574"></a>    &#39;et nisl sagittis vestibulum. Nullam nulla eros, ultricies sit amet, &#39; +
<a name="line575"></a>    &#39;nonummy id, imperdiet feugiat, pede. Sed lectus. Donec mollis hendrerit &#39; +
<a name="line576"></a>    &#39;risus. Phasellus nec sem in justo pellentesque facilisis. Etiam &#39; +
<a name="line577"></a>    &#39;imperdiet imperdiet orci. Nunc nec neque. Phasellus leo dolor, tempus &#39; +
<a name="line578"></a>    &#39;non, auctor et, hendrerit quis, nisi.\n\n&#39; +
<a name="line579"></a>
<a name="line580"></a>    &#39;Curabitur ligula sapien, tincidunt non, euismod vitae, posuere &#39; +
<a name="line581"></a>    &#39;imperdiet, leo. Maecenas malesuada. Praesent congue erat at massa. Sed &#39; +
<a name="line582"></a>    &#39;cursus turpis vitae tortor. Donec posuere vulputate arcu. Phasellus &#39; +
<a name="line583"></a>    &#39;accumsan cursus velit. Vestibulum ante ipsum primis in faucibus orci &#39; +
<a name="line584"></a>    &#39;luctus et ultrices posuere cubilia Curae; Sed aliquam, nisi quis &#39; +
<a name="line585"></a>    &#39;porttitor congue, elit erat euismod orci, ac placerat dolor lectus quis &#39; +
<a name="line586"></a>    &#39;orci. Phasellus consectetuer vestibulum elit. Aenean tellus metus, &#39; +
<a name="line587"></a>    &#39;bibendum sed, posuere ac, mattis non, nunc. Vestibulum fringilla pede &#39; +
<a name="line588"></a>    &#39;sit amet augue. In turpis. Pellentesque posuere. Praesent turpis.\n\n&#39; +
<a name="line589"></a>
<a name="line590"></a>    &#39;Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu &#39; +
<a name="line591"></a>    &#39;sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales &#39; +
<a name="line592"></a>    &#39;nec, volutpat a, suscipit non, turpis. Nullam sagittis. Suspendisse &#39; +
<a name="line593"></a>    &#39;pulvinar, augue ac venenatis condimentum, sem libero volutpat nibh, &#39; +
<a name="line594"></a>    &#39;nec pellentesque velit pede quis nunc. Vestibulum ante ipsum primis in &#39; +
<a name="line595"></a>    &#39;faucibus orci luctus et ultrices posuere cubilia Curae; Fusce id &#39; +
<a name="line596"></a>    &#39;purus. Ut varius tincidunt libero. Phasellus dolor. Maecenas vestibulum &#39; +
<a name="line597"></a>    &#39;mollis diam. Pellentesque ut neque. Pellentesque habitant morbi &#39; +
<a name="line598"></a>    &#39;tristique senectus et netus et malesuada fames ac turpis egestas.\n\n&#39; +
<a name="line599"></a>
<a name="line600"></a>    &#39;In dui magna, posuere eget, vestibulum et, tempor auctor, justo. In ac &#39; +
<a name="line601"></a>    &#39;felis quis tortor malesuada pretium. Pellentesque auctor neque nec &#39; +
<a name="line602"></a>    &#39;urna. Proin sapien ipsum, porta a, auctor quis, euismod ut, mi. Aenean &#39; +
<a name="line603"></a>    &#39;viverra rhoncus pede. Pellentesque habitant morbi tristique senectus et &#39; +
<a name="line604"></a>    &#39;netus et malesuada fames ac turpis egestas. Ut non enim eleifend felis &#39; +
<a name="line605"></a>    &#39;pretium feugiat. Vivamus quis mi. Phasellus a est. Phasellus magna.\n\n&#39; +
<a name="line606"></a>
<a name="line607"></a>    &#39;In hac habitasse platea dictumst. Curabitur at lacus ac velit ornare &#39; +
<a name="line608"></a>    &#39;lobortis. Curabitur a felis in nunc fringilla tristique. Morbi mattis &#39; +
<a name="line609"></a>    &#39;ullamcorper velit. Phasellus gravida semper nisi. Nullam vel sem. &#39; +
<a name="line610"></a>    &#39;Pellentesque libero tortor, tincidunt et, tincidunt eget, semper nec, &#39; +
<a name="line611"></a>    &#39;quam. Sed hendrerit. Morbi ac felis. Nunc egestas, augue at &#39; +
<a name="line612"></a>    &#39;pellentesque laoreet, felis eros vehicula leo, at malesuada velit leo &#39; +
<a name="line613"></a>    &#39;quis pede. Donec interdum, metus et hendrerit aliquet, dolor diam &#39; +
<a name="line614"></a>    &#39;sagittis ligula, eget egestas libero turpis vel mi. Nunc nulla. Fusce &#39; +
<a name="line615"></a>    &#39;risus nisl, viverra et, tempor et, pretium in, sapien. Donec venenatis &#39; +
<a name="line616"></a>    &#39;vulputate lorem.\n\n&#39; +
<a name="line617"></a>
<a name="line618"></a>    &#39;Morbi nec metus. Phasellus blandit leo ut odio. Maecenas ullamcorper, &#39; +
<a name="line619"></a>    &#39;dui et placerat feugiat, eros pede varius nisi, condimentum viverra &#39; +
<a name="line620"></a>    &#39;felis nunc et lorem. Sed magna purus, fermentum eu, tincidunt eu, &#39; +
<a name="line621"></a>    &#39;varius ut, felis. In auctor lobortis lacus. Quisque libero metus, &#39; +
<a name="line622"></a>    &#39;condimentum nec, tempor a, commodo mollis, magna. Vestibulum &#39; +
<a name="line623"></a>    &#39;ullamcorper mauris at ligula. Fusce fermentum. Nullam cursus lacinia &#39; +
<a name="line624"></a>    &#39;erat. Praesent blandit laoreet nibh.\n\n&#39; +
<a name="line625"></a>
<a name="line626"></a>    &#39;Fusce convallis metus id felis luctus adipiscing. Pellentesque egestas, &#39; +
<a name="line627"></a>    &#39;neque sit amet convallis pulvinar, justo nulla eleifend augue, ac &#39; +
<a name="line628"></a>    &#39;auctor orci leo non est. Quisque id mi. Ut tincidunt tincidunt erat. &#39; +
<a name="line629"></a>    &#39;Etiam feugiat lorem non metus. Vestibulum dapibus nunc ac augue. &#39; +
<a name="line630"></a>    &#39;Curabitur vestibulum aliquam leo. Praesent egestas neque eu enim. In &#39; +
<a name="line631"></a>    &#39;hac habitasse platea dictumst. Fusce a quam. Etiam ut purus mattis &#39; +
<a name="line632"></a>    &#39;mauris sodales aliquam. Curabitur nisi. Quisque malesuada placerat &#39; +
<a name="line633"></a>    &#39;nisl. Nam ipsum risus, rutrum vitae, vestibulum eu, molestie vel, &#39; +
<a name="line634"></a>    &#39;lacus.\n\n&#39; +
<a name="line635"></a>
<a name="line636"></a>    &#39;Sed augue ipsum, egestas nec, vestibulum et, malesuada adipiscing, &#39; +
<a name="line637"></a>    &#39;dui. Vestibulum facilisis, purus nec pulvinar iaculis, ligula mi &#39; +
<a name="line638"></a>    &#39;congue nunc, vitae euismod ligula urna in dolor. Mauris sollicitudin &#39; +
<a name="line639"></a>    &#39;fermentum libero. Praesent nonummy mi in odio. Nunc interdum lacus sit &#39; +
<a name="line640"></a>    &#39;amet orci. Vestibulum rutrum, mi nec elementum vehicula, eros quam &#39; +
<a name="line641"></a>    &#39;gravida nisl, id fringilla neque ante vel mi. Morbi mollis tellus ac &#39; +
<a name="line642"></a>    &#39;sapien. Phasellus volutpat, metus eget egestas mollis, lacus lacus &#39; +
<a name="line643"></a>    &#39;blandit dui, id egestas quam mauris ut lacus. Fusce vel dui. Sed in &#39; +
<a name="line644"></a>    &#39;libero ut nibh placerat accumsan. Proin faucibus arcu quis ante. In &#39; +
<a name="line645"></a>    &#39;consectetuer turpis ut velit. Nulla sit amet est. Praesent metus &#39; +
<a name="line646"></a>    &#39;tellus, elementum eu, semper a, adipiscing nec, purus. Cras risus &#39; +
<a name="line647"></a>    &#39;ipsum, faucibus ut, ullamcorper id, varius ac, leo. Suspendisse &#39; +
<a name="line648"></a>    &#39;feugiat. Suspendisse enim turpis, dictum sed, iaculis a, condimentum &#39; +
<a name="line649"></a>    &#39;nec, nisi. Praesent nec nisl a purus blandit viverra. Praesent ac &#39; +
<a name="line650"></a>    &#39;massa at ligula laoreet iaculis. Nulla neque dolor, sagittis eget, &#39; +
<a name="line651"></a>    &#39;iaculis quis, molestie non, velit.\n\n&#39; +
<a name="line652"></a>
<a name="line653"></a>    &#39;Mauris turpis nunc, blandit et, volutpat molestie, porta ut, ligula. &#39; +
<a name="line654"></a>    &#39;Fusce pharetra convallis urna. Quisque ut nisi. Donec mi odio, faucibus &#39; +
<a name="line655"></a>    &#39;at, scelerisque quis, convallis in, nisi. Suspendisse non nisl sit amet &#39; +
<a name="line656"></a>    &#39;velit hendrerit rutrum. Ut leo. Ut a nisl id ante tempus hendrerit. &#39; +
<a name="line657"></a>    &#39;Proin pretium, leo ac pellentesque mollis, felis nunc ultrices eros, &#39; +
<a name="line658"></a>    &#39;sed gravida augue augue mollis justo. Suspendisse eu ligula. Nulla &#39; +
<a name="line659"></a>    &#39;facilisi. Donec id justo. Praesent porttitor, nulla vitae posuere &#39; +
<a name="line660"></a>    &#39;iaculis, arcu nisl dignissim dolor, a pretium mi sem ut ipsum. &#39; +
<a name="line661"></a>    &#39;Curabitur suscipit suscipit tellus.\n\n&#39; +
<a name="line662"></a>
<a name="line663"></a>    &#39;Praesent vestibulum dapibus nibh. Etiam iaculis nunc ac metus. Ut id &#39; +
<a name="line664"></a>    &#39;nisl quis enim dignissim sagittis. Etiam sollicitudin, ipsum eu &#39; +
<a name="line665"></a>    &#39;pulvinar rutrum, tellus ipsum laoreet sapien, quis venenatis ante &#39; +
<a name="line666"></a>    &#39;odio sit amet eros. Proin magna. Duis vel nibh at velit scelerisque &#39; +
<a name="line667"></a>    &#39;suscipit. Curabitur turpis. Vestibulum suscipit nulla quis orci. Fusce &#39; +
<a name="line668"></a>    &#39;ac felis sit amet ligula pharetra condimentum. Maecenas egestas arcu &#39; +
<a name="line669"></a>    &#39;quis ligula mattis placerat. Duis lobortis massa imperdiet quam. &#39; +
<a name="line670"></a>    &#39;Suspendisse potenti.\n\n&#39; +
<a name="line671"></a>
<a name="line672"></a>    &#39;Pellentesque commodo eros a enim. Vestibulum turpis sem, aliquet eget, &#39; +
<a name="line673"></a>    &#39;lobortis pellentesque, rutrum eu, nisl. Sed libero. Aliquam erat &#39; +
<a name="line674"></a>    &#39;volutpat. Etiam vitae tortor. Morbi vestibulum volutpat enim. Aliquam &#39; +
<a name="line675"></a>    &#39;eu nunc. Nunc sed turpis. Sed mollis, eros et ultrices tempus, mauris &#39; +
<a name="line676"></a>    &#39;ipsum aliquam libero, non adipiscing dolor urna a orci. Nulla porta &#39; +
<a name="line677"></a>    &#39;dolor. Class aptent taciti sociosqu ad litora torquent per conubia &#39; +
<a name="line678"></a>    &#39;nostra, per inceptos hymenaeos.\n\n&#39; +
<a name="line679"></a>
<a name="line680"></a>    &#39;Pellentesque dapibus hendrerit tortor. Praesent egestas tristique nibh. &#39; +
<a name="line681"></a>    &#39;Sed a libero. Cras varius. Donec vitae orci sed dolor rutrum auctor. &#39; +
<a name="line682"></a>    &#39;Fusce egestas elit eget lorem. Suspendisse nisl elit, rhoncus eget, &#39; +
<a name="line683"></a>    &#39;elementum ac, condimentum eget, diam. Nam at tortor in tellus interdum &#39; +
<a name="line684"></a>    &#39;sagittis. Aliquam lobortis. Donec orci lectus, aliquam ut, faucibus &#39; +
<a name="line685"></a>    &#39;non, euismod id, nulla. Curabitur blandit mollis lacus. Nam adipiscing. &#39; +
<a name="line686"></a>    &#39;Vestibulum eu odio.\n\n&#39; +
<a name="line687"></a>
<a name="line688"></a>    &#39;Vivamus laoreet. Nullam tincidunt adipiscing enim. Phasellus tempus. &#39; +
<a name="line689"></a>    &#39;Proin viverra, ligula sit amet ultrices semper, ligula arcu tristique &#39; +
<a name="line690"></a>    &#39;sapien, a accumsan nisi mauris ac eros. Fusce neque. Suspendisse &#39; +
<a name="line691"></a>    &#39;faucibus, nunc et pellentesque egestas, lacus ante convallis tellus, &#39; +
<a name="line692"></a>    &#39;vitae iaculis lacus elit id tortor. Vivamus aliquet elit ac nisl. Fusce &#39; +
<a name="line693"></a>    &#39;fermentum odio nec arcu. Vivamus euismod mauris. In ut quam vitae &#39; +
<a name="line694"></a>    &#39;odio lacinia tincidunt. Praesent ut ligula non mi varius sagittis. &#39; +
<a name="line695"></a>    &#39;Cras sagittis. Praesent ac sem eget est egestas volutpat. Vivamus &#39; +
<a name="line696"></a>    &#39;consectetuer hendrerit lacus. Cras non dolor. Vivamus in erat ut urna &#39; +
<a name="line697"></a>    &#39;cursus vestibulum. Fusce commodo aliquam arcu. Nam commodo suscipit &#39; +
<a name="line698"></a>    &#39;quam. Quisque id odio. Praesent venenatis metus at tortor pulvinar &#39; +
<a name="line699"></a>    &#39;varius.\n\n&#39;;
<a name="line700"></a>
<a name="line701"></a>/**
<a name="line702"></a> * Sample that the generated text is based on .
<a name="line703"></a> * @type {string}
<a name="line704"></a> */
<a name="line705"></a>goog.text.LoremIpsum.prototype.sample_ = goog.text.LoremIpsum.SAMPLE_;
<a name="line706"></a>
<a name="line707"></a>
<a name="line708"></a>/**
<a name="line709"></a> * Dictionary of words.
<a name="line710"></a> * @type {string}
<a name="line711"></a> */
<a name="line712"></a>goog.text.LoremIpsum.prototype.dictionary_ = goog.text.LoremIpsum.DICT_;
</pre>


</body>
</html>
